/**
 * 
 */
package gmu.drr.entity;

import java.util.ArrayList;
import java.util.Collection;

/** 
 * @author RothmD01
 */
public class NetNode {

	private boolean newActivated = false;
	
	private boolean isActivated = false;
	
	public boolean isNewActivated() {
		return newActivated;
	}

	public void setNewActivated(boolean newActivated) {
		this.newActivated = newActivated;
	}

	public boolean isActivated() {
		return isActivated;
	}

	public void setActivated(boolean isActivated) {
		this.isActivated = isActivated;
	}

	/**
	 * @uml.property  name="user"
	 * @uml.associationEnd  inverse="netNode:gmu.drr.entity.User"
	 */
	private User user;

	/**
	 * Getter of the property <tt>user</tt>
	 * @return  Returns the user.
	 * @uml.property  name="user"
	 */
	public User getUser() {
		return user;
	}

	/**
	 * Setter of the property <tt>user</tt>
	 * @param user  The user to set.
	 * @uml.property  name="user"
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @uml.property  name="sucEdge"
	 * @uml.associationEnd  multiplicity="(0 -1)" inverse="headNode:gmu.drr.entity.NetEdge"
	 */
	private Collection<NetEdge> sucEdge;

	/**
	 * Getter of the property <tt>sucEdge</tt>
	 * @return  Returns the sucEdge.
	 * @uml.property  name="sucEdge"
	 */
	public Collection<NetEdge> getSucEdge() {
		return sucEdge;
	}

	/**
	 * Setter of the property <tt>sucEdge</tt>
	 * @param sucEdge  The sucEdge to set.
	 * @uml.property  name="sucEdge"
	 */
	public void setSucEdge(Collection<NetEdge> sucEdge) {
		this.sucEdge = sucEdge;
	}

	/** 
	 * @uml.property name="predEdge"
	 * @uml.associationEnd multiplicity="(0 -1)" inverse="tailNode:gmu.drr.entity.NetEdge"
	 */
	private Collection<NetEdge> predEdge;

	/** 
	 * Getter of the property <tt>predEdge</tt>
	 * @return  Returns the predEdge.
	 * @uml.property  name="predEdge"
	 */
	public Collection<NetEdge> getPredEdge() {
		return predEdge;
	}

	/** 
	 * Setter of the property <tt>predEdge</tt>
	 * @param predEdge  The predEdge to set.
	 * @uml.property  name="predEdge"
	 */
	public void setPredEdge(Collection<NetEdge> predEdge) {
		this.predEdge = predEdge;
	}

	/**
	 * @uml.property  name="netNodeActModel"
	 * @uml.associationEnd  inverse="netNode:gmu.drr.entity.NetNodeActModel"
	 */
	private NetNodeActModel netNodeActModel;

	/**
	 * Getter of the property <tt>netNodeActModel</tt>
	 * @return  Returns the netNodeActModel.
	 * @uml.property  name="netNodeActModel"
	 */
	public NetNodeActModel getNetNodeActModel() {
		return netNodeActModel;
	}

	/**
	 * Setter of the property <tt>netNodeActModel</tt>
	 * @param netNodeActModel  The netNodeActModel to set.
	 * @uml.property  name="netNodeActModel"
	 */
	public void setNetNodeActModel(NetNodeActModel netNodeActModel) {
		this.netNodeActModel = netNodeActModel;
	}

	/**
	 * for an iteration of a time-model, retain the old activation value until
	 * all the iteration evaluations have been performed.
	 */
	public void lagUpdate() {
		isActivated = newActivated;
	}
	
	public void addPredEdge( NetEdge e ) {
		predEdge.add(e);
	}
	
	public void addSucEdge( NetEdge e ) {
		sucEdge.add(e);
		
	}

	/**
	 * @param newActivated
	 * @param isActivated
	 * @param user
	 * @param sucEdge
	 * @param predEdge
	 * @param netNodeActModel
	 */
	public NetNode() {
		sucEdge = new ArrayList<NetEdge>();
		predEdge = new ArrayList<NetEdge>();
	}
	
	public NetNode( User newU) {
		user = newU;
		sucEdge = new ArrayList<NetEdge>();
		predEdge = new ArrayList<NetEdge>();
	}
}
